package com.wmlive.hhvideo.heihei.beans.bell;

import com.wmlive.hhvideo.common.base.BaseModel;
import com.wmlive.hhvideo.heihei.beans.main.Author;

/**
 * 铃铛消息
 * Created by vhawk on 2017/7/5.
 */
public class BellMessage extends BaseModel {


    /**
     * msg_type : comment
     * from_user : {"name":"senga","cover_url":"","honours":[],"dc_num":"","id":10017,"description":""}
     * to_user : {"name":"小强","cover_url":"","honours":[],"dc_num":"","id":10018,"description":""}
     * content : {"title":"评论了你的作品 or 回复你","desc":"回复或评论内容","extr_param":{"comment_id":1002,"opus_id":1002,"user_id":122123},"jump":{"icon":"作品封面url","link":"hhvideo://opus/detail?id=10001"}}
     * msg_id : 1234567890123456
     * create_time : 1348831860
     * tips : 【评论消息】不支持的消息类型，请升级最新客户端。
     */

    /**
     * 消息类型
     */
    private String msg_type;
    /**
     * 发起者
     */
    private Author from_user;
    /**
     * 接收者
     */
    private Author to_user;

    private BellContent content;
    private String msg_id;
    private long create_time;
    private String tips;
    private int isRead;//0:未读  1：已读
    private String create_time_db;//入库时间

    public int getIsRead() {
        return isRead;
    }

    public void setIsRead(int isRead) {
        this.isRead = isRead;
    }

    public String getCreate_time_db() {
        return create_time_db;
    }

    public void setCreate_time_db(String create_time_db) {
        this.create_time_db = create_time_db;
    }

    private long listid;//列表id,本地数据库中的索引

    public long getListid() {
        return listid;
    }

    public BellMessage setListid(Long listid) {
        this.listid = listid;
        return this;
    }

    public String getMsg_type() {
        return msg_type;
    }

    public BellMessage setMsg_type(String msg_type) {
        this.msg_type = msg_type;
        return this;
    }

    public Author getFrom_user() {
        return from_user;
    }

    public BellMessage setFrom_user(Author from_user) {
        this.from_user = from_user;
        return this;
    }

    public Author getTo_user() {
        return to_user;
    }

    public BellMessage setTo_user(Author to_user) {
        this.to_user = to_user;
        return this;
    }

    public BellContent getContent() {
        return content;
    }

    public BellMessage setContent(BellContent content) {
        this.content = content;
        return this;
    }

    public String getMsg_id() {
        return msg_id;
    }

    public BellMessage setMsg_id(String msg_id) {
        this.msg_id = msg_id;
        return this;
    }

    public long getCreate_time() {
        return create_time;
    }

    public BellMessage setCreate_time(long create_time) {
        this.create_time = create_time;
        return this;
    }

    public String getTips() {
        return tips;
    }

    public BellMessage setTips(String tips) {
        this.tips = tips;
        return this;
    }

    public String getLink() {
        return getContent() == null ? null : getContent().getJump() == null ? null : getContent().getJump().getLink();
    }

    public long getUserId() {
        return getFrom_user() == null ? 0 : getFrom_user().getId();
    }

    public boolean isFollowAuthor() {
        return getTo_user() == null ? false : getFrom_user().getRelation() == null ? false : getFrom_user().getRelation().isIs_follow();
    }

    public long getVideoId() {
        return getContent() == null ? 0 : getContent().getExtr_param() == null ? 0 : getContent().getExtr_param().getOpus_id();
    }

    public String getOtherName() {
        return getFrom_user() == null ? null : getFrom_user().getName();
    }

    public String getTitle() {
        return getContent() == null ? null : getContent().getTitle();
    }

    public String getProfile() {
        return getFrom_user() == null ? null : getFrom_user().getCover_url();
    }

    public String getThumbnail() {
        return getContent() == null ? null : getContent().getJump() == null ? null : getContent().getJump().getIcon();
    }

    public String getOfficialText() {
        return getContent() == null ? null : getContent().getJump() == null ? null : getContent().getJump().getText();
    }

    public String getDesc() {
        return getContent() == null ? null :getContent().getDesc();
    }

    public String getContentIcon() {
        return getContent() == null ? null : getContent().getIcon();
    }

    public String getJumpIcon() {
        return getContent() == null ? null : getContent().getJump() == null ? null : getContent().getJump().getIcon();
    }
}
